App({
    onLaunch: function() {},
    onShow: function() {
        console.log(getCurrentPages());
    },
    onHide: function() {
        console.log(getCurrentPages());
    },
    onError: function(e) {
        console.log(e);
    },
    getUserInfo: function(e) {
        var n = this;
        wx.login({
            success: function(t) {
                console.log(t.code), n.util.request({
                    url: "entry/wxapp/Openid",
                    cachetime: "0",
                    data: {
                        code: t.code
                    },
                    header: {
                        "content-type": "application/json"
                    },
                    dataType: "json",
                    success: function(t) {
                        console.log("openid信息", t.data), getApp().getOpenId = t.data.openid, getApp().getSK = t.data.session_key, 
                        wx.getUserInfo({
                            withCredentials: !1,
                            success: function(o) {
                                console.log(o.userInfo), n.util.request({
                                    url: "entry/wxapp/login",
                                    cachetime: "0",
                                    data: {
                                        openid: t.data.openid,
                                        img: o.userInfo.avatarUrl,
                                        name: o.userInfo.nickName
                                    },
                                    header: {
                                        "content-type": "application/json"
                                    },
                                    dataType: "json",
                                    success: function(n) {
                                        console.log("用户信息", n), getApp().getuniacid = n.data.uniacid, wx.setStorageSync("UserData", n.data), 
                                        e(n.data);
                                    }
                                });
                            },
                            fail: function() {
                                wx.showModal({
                                    title: "提示",
                                    content: "您点击了拒绝个人头像等信息授权,无法正常使用此小程序,点击确定重新获取授权。",
                                    showCancel: !1,
                                    success: function(o) {
                                        o.confirm && wx.openSetting({
                                            success: function(o) {
                                                o.authSetting["scope.userInfo"] ? wx.getUserInfo({
                                                    success: function(o) {
                                                        console.log(o.userInfo), n.util.request({
                                                            url: "entry/wxapp/login",
                                                            cachetime: "0",
                                                            data: {
                                                                openid: t.data.openid,
                                                                img: o.userInfo.avatarUrl,
                                                                name: o.userInfo.nickName
                                                            },
                                                            header: {
                                                                "content-type": "application/json"
                                                            },
                                                            dataType: "json",
                                                            success: function(n) {
                                                                console.log("用户信息", n), getApp().getuniacid = n.data.uniacid, wx.setStorageSync("UserData", n.data), 
                                                                e(n.data);
                                                            }
                                                        });
                                                    }
                                                }) : (console.log("用户再次拒绝"), n.util.request({
                                                    url: "entry/wxapp/login",
                                                    cachetime: "0",
                                                    data: {
                                                        openid: t.data.openid,
                                                        img: "",
                                                        name: ""
                                                    },
                                                    header: {
                                                        "content-type": "application/json"
                                                    },
                                                    dataType: "json",
                                                    success: function(n) {
                                                        console.log("用户信息", n), getApp().getuniacid = n.data.uniacid, wx.setStorageSync("UserData", n.data), 
                                                        e(n.data);
                                                    }
                                                }));
                                            },
                                            fail: function(e) {}
                                        });
                                    }
                                });
                            },
                            complete: function(e) {}
                        });
                    },
                    fail: function(e) {},
                    complete: function(e) {}
                });
            }
        });
    },
    util: require("we7/resource/js/util.js"),
    tabBar: {
        color: "#123",
        selectedColor: "#1ba9ba",
        borderStyle: "#1ba9ba",
        backgroundColor: "#fff",
        list: [ {
            pagePath: "/we7/pages/index/index",
            iconPath: "/we7/resource/icon/home.png",
            selectedIconPath: "/we7/resource/icon/homeselect.png",
            text: "首页"
        }, {
            pagePath: "/we7/pages/user/index/index",
            iconPath: "/we7/resource/icon/user.png",
            selectedIconPath: "/we7/resource/icon/userselect.png",
            text: "微擎我的"
        } ]
    },
    globalData: {
        userInfo: null
    },
    siteInfo: require("siteinfo.js")
});